package com.free4k.hss.config;

//简易i定义返回结果
public class MyResult {

    int code;
    String msg;
    Object data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public MyResult() {
    }

    public static MyResult ok(Object data){
        MyResult result = new MyResult();
        result.setCode(200);
        result.setMsg("success");
        result.setData(data);
        return result;
    }

    public static MyResult ok(String msg, Object data){
        MyResult result = new MyResult();
        result.setCode(200);
        result.setMsg(msg);
        result.setData(data);
        return result;
    }

}
